#!/bin/sh

sudo apt-get update
sudo apt-get install screen -y
chmod +x ~/dst-server/*.sh ~/dst-server/dst/bin/*.sh

platform=`uname -m`
if [ $platform='x86_64' ]
then
    cd ~/dst-server
    ./dependency.sh
fi

cd ~/dst-server/steamcmd
tar xzf steamcmd_linux.tar.gz
cd ..
./steamcmd/steamcmd.sh +login anonymous +force_install_dir ~/dst-server/dst +app_update 343050 validate +quit
echo '!!!THE SERVER HAS BEEN INITIATED!!!'